<include file="public@header"/>
<style>

    .uid_list{
        margin: 0;
        padding: 0;
    }
    .uid_list ul{
        margin: 0;
        padding: 0;
    }
    .uid_list li{
        display: inline-block;
        float: left;
        position: relative;
        list-style: none;
    }
    .uid_list span{
        display: inline-block;
        margin-right: 10px;
        padding: 0 18px;
        min-width: 80px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        color: #323232;
        font-size: 14px;
        background: #ffffff;
        border: 1px solid #f0f0f0;
        border-radius: 5px;
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
        -o-box-sizing: border-box;
        -ms-box-sizing: border-box;
        box-sizing: border-box;
    }
    .uid_list span.on {
        margin: 0;
        color: #38DAA6;
        border: 1px dashed #38daa6;
        cursor: pointer;
    }
    .uid_list li i{
        position: absolute;
        top: 3px;
        right: 13px;
        width: 10px;
        height: 10px;
        background: url('/static/teacher/images/white/practice_del.png') no-repeat center center;
        background-size: 10px 10px;
        cursor: pointer;
    }


</style>
</head>
<body>

<!--新闻添加页面-->


<div class="layui-fluid">

    <form method="post" class="layui-form js-ajax-form" style="margin-top: 20px;" action="{:url('news/addPost')}">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-tab layui-tab-brief">
                    <ul class="layui-tab-title">
                        <li><a href="{:url('news/index')}">列表</a></li>
                        <li class="layui-this"><a href="{:url('news/add')}">添加</a></li>
                    </ul>
                    <div class="layui-card-body">

                        <div class="layui-form-item">
                            <label for="input-name" class="layui-form-label"><span class="form-required">*</span>标题</label>
                            <div class="layui-input-block">
                                <input type="text" class="layui-input" id="input-name" name="name">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="form-required">*</span>封面</label>
                            <div class="layui-input-block">
                                <input type="hidden" name="thumb" id="thumb" value="">
                                <a href="javascript:uploadOneImage('图片上传','#thumb');">
                                    <img src="__TMPL__/public/assets/images/default-thumbnail.png" id="thumb-preview"
                                         style="cursor: pointer;max-width:150px;max-height:150px;"/>
                                </a>
                                <div class="layui-col-md12" style="margin-top: 10px">
                                    <input type="button" class="layui-btn layui-btn-sm layui-btn-normal"
                                           onclick="$('#thumb-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;"
                                           value="取消图片">
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label for="input-name" class="layui-form-label"><span class="form-required">*</span>内容</label>
                            <div class="layui-input-block">
                                <script type="text/plain" id="content" name="content"></script>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button type="submit" class="layui-btn js-ajax-submit">{:lang('ADD')}</button>
                            </div>
                        </div>


                    </div>
                </div>
            </div>
        </div>

    </form>
</div>

<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/wind.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    $(function () {
        Wind.use('layer');

        $('.btn-cancel-thumbnail').click(function () {
            $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#thumbnail').val('');
        });
        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        try {
            editorcontent.sync();
        } catch (err) {
        }

        editorcontent2 = new baidu.editor.ui.Editor();
        editorcontent2.render('info');
        try {
            editorcontent2.sync();
        } catch (err) {
        }


    });
</script>
</body>
</html>